package com.zhiyou100.interface_demo3;

/**
 * 警察
 */
public class Police implements Work{

    private String name;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Police(String name) {
        this.name = name;
    }

    @Override
    public void startWork() {
        System.out.println(name + "警察开始上班抓坏人");
    }

    @Override
    public void endWork() {
        System.out.println(name + "警察收队下班");
    }

    @Override
    public void abideByLaw() {
        System.out.println(name + "警察一定要遵守法律");
    }

    @Override
    public void sport() {
        System.out.println("警察需要强身健体");
    }
}
